<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button id="btn1">点我</button>
  <script>
    //js对象
    var obj1 = { name: 'lisi' };
    //在js中获取html元素叫做[dom对象]
    var oBtn1 = document.getElementById("btn1");
    //给按钮绑定了单击事件，会监听用户单击（该dom对象）的动作
    oBtn1.onclick = function () {
      console.log(111);
      console.log(this);//this指向谁(obtn1)
    }
    oBtn1.onclick();
    console.log(oBtn1);
  </script>
</body>

</html>